package com.example.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.SensitiveWord;
import com.example.mapper.SensitiveWordMapper;
import com.example.service.SensitiveWordService;
import com.github.houbb.sensitive.word.bs.SensitiveWordBs;

@Component
public class SensitiveWordServiceImpl extends ServiceImpl<SensitiveWordMapper, SensitiveWord>
        implements SensitiveWordService {

    @Override
    public List<SensitiveWord> listDeny() {
        LambdaQueryWrapper<SensitiveWord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.gt(SensitiveWord::getStatus, 0);
        List<SensitiveWord> list = list(lambdaQueryWrapper);
        return list;
    }

    @Override
    public List<SensitiveWord> listAllow() {
        LambdaQueryWrapper<SensitiveWord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.lt(SensitiveWord::getStatus, 0);
        List<SensitiveWord> list = list(lambdaQueryWrapper);
        return list;
    }


}
